package com.whw.cbf_qimodazuoye.utils;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class DaysUtil {
    //传入的起止日期，返回一共差几天
    public static int queryNumberByStartAndEnd(Date start, Date end) {
        List<String> list = new ArrayList<String>();
        long s = start.getTime();
        long e = end.getTime();
        Long oneDay = 1000 * 60 * 60 * 24l;
        while (s <= e) {
            start = new Date(s);
            list.add(new SimpleDateFormat("yyyy-MM-dd").format(start));
            s += oneDay;
        }
        return list.size();
    }
}
